﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace LUC.Services
{
	class QueryForm : Form
	{
		public Button b_ok;
		public Button b_cancel;

		public QueryForm(string caption)
			: base()
		{
			Text = caption;
			
			FormBorderStyle = FormBorderStyle.FixedToolWindow;
			Size = new Size(10, 10);
			StartPosition = FormStartPosition.CenterParent;
			
			b_cancel = new Button();
			b_cancel.Text = "Cancel";
			b_cancel.Parent = this;
			b_cancel.AutoSize = true;
			b_cancel.Anchor = (AnchorStyles)(AnchorStyles.Bottom | AnchorStyles.Right);
			b_cancel.Click += new EventHandler(b_cancel_Click);
			b_cancel.Left = this.ClientRectangle.Width - b_cancel.Width - 5;
			b_cancel.Top = this.ClientRectangle.Height - b_cancel.Height - 5;
			
			b_ok = new Button();
			b_ok.Text = "OK";
			b_ok.Parent = this;
			b_ok.AutoSize = true;
			b_ok.Anchor = (AnchorStyles)(AnchorStyles.Bottom | AnchorStyles.Right);
			b_ok.Click += new EventHandler(b_ok_Click);
			b_ok.Left = b_cancel.Left - b_ok.Width - 5;
			b_ok.Top = b_cancel.Top;

			AcceptButton = b_ok;
			CancelButton = b_cancel;
		}

		void b_ok_Click(object sender, EventArgs e)
		{
			DialogResult = DialogResult.OK;
			Close();
		}

		void b_cancel_Click(object sender, EventArgs e)
		{
			DialogResult = DialogResult.Cancel;
			Close();
		}

		private void InitializeComponent()
		{
			this.SuspendLayout();
			// 
			// QueryForm
			// 
			this.ClientSize = new System.Drawing.Size(292, 273);
			this.Name = "QueryForm";
			this.ResumeLayout(false);

		}
	}
}
